<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="jsp_header.jsp" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"  %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
#div1{
	 width:710px;
     height:155px; 
     text-align:center; 
     margin-left: 20%;
}
</style>
<head>
<title>Gilly의 홈쇼핑</title>
<link type="text/css" rel="stylesheet" href="/resources/common/common.css">
<script language="javascript">
	function cart_edit(kind, pos) {
		alert(kind, pos);
		if (kind == "deleteall") {
			location.href = "/cart/cartClear";
		} else if (kind == "delete") {
			location.href = "/cart/cartDelete?pos="+pos;
		} else if (kind == "update") {
			var num=eval("form2.quantity"+pos).value;
			location.href =  "/cart/cartEdit?num="+num+"&pos="+pos; 
		}
	}
</script>



</head>
<body>
	<jsp:include page="main_header.jsp"></jsp:include>

	<!-- 사이드바 -->

	<!-- Content, 중앙 슬라이드바 -->
	<div id="container" class="board mg40">
	<table class="list" id="ID_BASKET_ITEMS" border="0" cellpadding="0" cellspacing="0" width="747" style="position:relative; ,left:30%;">
		<tr>
			<td height="13"></td>
		</tr>
	</table>
	<table border="0" cellpadding="0" cellspacing="0" width="746">
		<tr>
			<td height="30" align="left"><img src="/resources/image/cart_title.gif"
				width="746" height="30" border="0"></td>
		</tr>
	</table>
	<div class="title">
	<h2 class="kr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;쇼핑백</h2>
	</div>
	<table>
				<a><img src="/resources/image/cartimg.PNG" align="center"></a>
			</table>
	<table border="0" cellpadding="0" cellspacing="0" width="747">
		<tr>
			<td height="13"></td>
		</tr>
	</table>

	<table border="0" cellpadding="0" cellspacing="0" width="710"
		class="cmfont">
		<tr>
			<td><img src="/resources/image/cart_title1.gif" border="0"></td>
		</tr>
	</table>

	<table border="0" cellpadding="0" cellspacing="0" width="710">
		<tr>
			<td height="10"></td>
		</tr>
	</table>
	<table border="0" cellpadding="5" cellspacing="1" width="800" class="cmfont" bgcolor="F0F0F0">
		<tr bgcolor="F0F0F0" height="40" class="cmfont">
			<td width="420" align="center">상품</td>
			<td width="70" align="center">수량</td>
			<td width="80" align="center">가격</td>
			<td width="90" align="center">합계</td>
			<td width="50" align="center">수정/삭제</td>
		</tr>
			
		
		<form name="form2" method="post" style="width: 821px; ">
		<c:forEach items="${sessionScope.itemList}" var="itemList" varStatus="cnt">
			<tr>
				<td height='60' align='center' bgcolor='#FFFFFF'>
					<table cellpadding='0' cellspacing='0' width='100%'>
						<tr>
							<td width='100' height="100">
								<img class="img" src="/resources/image/${itemList.image}" width='85' height='85' border='0'></a>
							</td>
							<td class='set_product'>
								<a href='ProductDetail?no=${itemList.no}'>${itemList.name}</a><br>
								<font color='#0066CC'>[옵션사항]</font>${itemList.opts1} &nbsp; ${itemList.opts2}
							</td>
						</tr>
					
					</table>
				</td>
							
				<td align='center' bgcolor='#FFFFFF'>
					<input type='text' name='quantity${cnt.index}' size='3' value='${itemList.quantity}' class='cmfont1'><font color='#464646'>개</font>
				</td>
							
				<td align='center' bgcolor='#FFFFFF'><font color='#464646'><fmt:formatNumber value="${itemList.price}" type="currency"/></font></td>
				<td align='center' bgcolor='#FFFFFF'><font color='#464646'><fmt:formatNumber value="${itemList.price * itemList.quantity}" type="currency"/></font></td>
				<td align='center' bgcolor='#FFFFFF'>
					<a href = "javascript:cart_edit('update', '${cnt.index}' )"><img src='/resources/image/button1.PNG' border='0'></a>
					
				</td>
				<td align='center' bgcolor='#FFFFFF'>
				<a href = "javascript:cart_edit('delete', '${cnt.index}')"><img src='/resources/image/button2.PNG' border='0'></a>
				</td>
			</tr>
		</c:forEach>
					
		</form>
		<tr>
			<td colspan='5' bgcolor='#F0F0F0'>
			<table width='100%' border='0' cellpadding='0' cellspacing='0' class='cmfont'>
					<tr>
						<td bgcolor='#F0F0F0'><img src='/resources/image/cart_image1.gif' border='0'></td>
						<td align='right' bgcolor='#F0F0F0'>
							<font color='#0066CC'><b>총 합계금액</font></b> : 상품대금(<fmt:formatNumber value="${AmountTotal}" type="currency"/>) + 배송료(<fmt:formatNumber value="2500" type="currency"/>) = <font color='#FF3333'><b><fmt:formatNumber value="${AmountTotal + 2500 }" type="currency"/></b></font>&nbsp;&nbsp;
						</td>
					</tr>
				</table>
			</td>
		</tr>
		
</table>			
	<!-- form2 끝  -->
	<table width="710" border="0" cellpadding="0" cellspacing="0" class="cmfont" style="height: 177px; ">
		<tr height="44">
			<td width="710" align="center" valign="middle">
			<a href="/"><img src="/resources/image/b_shopping.gif" border="0"></a>&nbsp;&nbsp;
				<a href="javascript:cart_edit('deleteall',0)"><img
					src="/resources/image/b_cartalldel.gif" width="103" height="26" border="0"></a>&nbsp;&nbsp;
				<a href="/order/orderForm"><img src="/resources/image/b_order1.gif" border="0"></a>
			</td>
		</tr>
	</table>
</div>
	<!-------------------------------------------------------------------------------------------->
	<!-- 끝 : 다른 웹페이지 삽입할 부분                                                         -->
	<!-------------------------------------------------------------------------------------------->

	<jsp:include page="main_bottom.jsp"></jsp:include>
	</div>
</body>
</html>